package com.wonking.springbootv2.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.wonking.springbootv2.service.AsyncService;

@RestController
@RequestMapping("/async")
public class AsyncController {
	
	@Autowired
	private AsyncService asyncService;
	
	@GetMapping
	public String test(){
		
		System.out.println("请求线程名称为：" + "【" + Thread.currentThread().getName() + "】");
		// 调用异步服务
		asyncService.generateReport();
		return "asynca auta2";
	}

}
